package co.yixiang.yshop.module.product.api.productrelation;

import co.yixiang.yshop.module.product.controller.app.relation.vo.AppStoreProductRelationQueryVo;
import co.yixiang.yshop.module.product.convert.storeproductrelation.StoreProductRelationConvert;
import co.yixiang.yshop.module.product.service.storeproductrelation.AppStoreProductRelationService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author pepis
 * @apiNote
 **/
@Service
public class ProductRelationApiImpl implements ProductRelationApi{
    @Resource
    private AppStoreProductRelationService appStoreProductRelationService;
    @Override
    public List<AppStoreProductRelationQueryDTO> userCollectRootProductList(Long uid, String type) {
        List<AppStoreProductRelationQueryVo> appStoreProductRelationQueryVos = appStoreProductRelationService.userCollectRootProductList(1, 20, uid, type);
        List<AppStoreProductRelationQueryDTO> list = StoreProductRelationConvert.INSTANCE.convertList2(appStoreProductRelationQueryVos);
        return list;
    }
}
